package club.janna.jrpc.cluster.loadbalance.selector;

/**
 * 通用轮询选择器
 * @author Panbo.Guo
 */
public class GenericRoundSelector extends AbstractRoundSelector {

    private final int radix;

    public GenericRoundSelector(int radix) {
        this.radix = radix;
    }

    @Override
    protected int next(int count) {
        return Math.abs(count) % radix;
    }
}
